<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UserRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'account'  => 'required',
            'password' => 'required',
            'point'    => 'required|numeric|between:2,6'
        ];
    }

    public function messages(){
        return [
            'account.required' => '必须填写账号',
            'password.required' => '必须填写密码',
            'point.required' => '必须填写费率',
            'point.between' => '必须是2-6之间',
            'point.numeric' => '必须是2-6之间'
        ];
    }
}
